<template>
  <div id="app">
    <router-view v-on:mycarlength="mycarlength"></router-view>
    <van-tabbar v-model="active" route>
      <van-tabbar-item name="home" icon="wap-home-o" to="/home"
        >首页</van-tabbar-item
      >
      <van-tabbar-item icon="contact" to="/member">会员</van-tabbar-item>
      <van-tabbar-item icon="shopping-cart-o" to="/carList" :badge="count"
        >购物车</van-tabbar-item
      >
      <van-tabbar-item icon="search" to="/search">搜索</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script>
export default {
  name: "App",
  data() {
    return {
      active: "name",
      count: 0,
    };
  },
  methods: {
    mycarlength(data) {
      this.count = data
    },
  },
};
</script>

<style lang="less">
@import url(http://at.alicdn.com/t/font_2572856_x9a4kfuqge.css);
</style>
